package cn.yunyichina.provider.pay.wechat.main;

import cn.yunyichina.provider.framework.data.SpringContextHandler;
import cn.yunyichina.provider.framework.dubbo.service.impl.YytServiceImpl;
import cn.yunyichina.provider.iface.entity.common.ResCommon;
import cn.yunyichina.provider.iface.entity.dto.pay.*;
import cn.yunyichina.provider.iface.entity.dto.wechat.WechatWebPayRequestDTO;
import cn.yunyichina.provider.iface.entity.dto.wechat.WechatWebPayResponseDTO;
import cn.yunyichina.provider.iface.entity.pay.WechatMedicalBillDownloadRequest;
import cn.yunyichina.provider.iface.entity.pay.WechatMedicalBillDownloadResponse;
import cn.yunyichina.provider.iface.entity.wechat.WechatMedicalRefundRequest;
import cn.yunyichina.provider.iface.entity.wechat.WechatMedicalRefundResponse;
import cn.yunyichina.provider.iface.service.IWechatpay;
import cn.yunyichina.provider.pay.wechat.service.WechatPayService;
import cn.yunyichina.provider.pay.wechat.service.impl.WechatRefundServiceImpl;

public class WetchatPayServiceImpl extends YytServiceImpl implements IWechatpay {

    @Override
    public String getErrorCode() {
        return "12000";
    }

    @Override
    public WechatMedicalRefundResponse wechatMedicalRefund(WechatMedicalRefundRequest request) {
        return ((WechatRefundServiceImpl) SpringContextHandler.getBean("wechatRefundServiceImpl")).wechatMedicalRefund(request);
    }

    @Override
    public ResCommon<WechatMicroPayResponseDTO> microWechatPay(WechatMicroPayRequestDTO wechatMicroPayRequestDTO) {
        return SpringContextHandler.getBean(WechatPayService.class).microWechatPay(wechatMicroPayRequestDTO);
    }

    @Override
    public ResCommon<WechatOrderQueryResponseDTO> queryWechatOrder(WechatOrderQueryRequestDTO wechatOrderQueryRequestDTO) {
        return SpringContextHandler.getBean(WechatPayService.class).queryWechatOrder(wechatOrderQueryRequestDTO);
    }

    @Override
    public ResCommon<WechatOrderReverseResponseDTO> reverseWechatOrder(WechatOrderReverseRequestDTO wechatOrderReverseRequestDTO) {
        return SpringContextHandler.getBean(WechatPayService.class).reverseWechatOrder(wechatOrderReverseRequestDTO);
    }

    @Override
    public ResCommon<WechatMedicalBillDownloadResponse> downloadWechatMedicalBill(WechatMedicalBillDownloadRequest request) {
        return SpringContextHandler.getBean(WechatPayService.class).downloadWechatMedicalBill(request);
    }

    @Override
    public ResCommon<WechatWebPayResponseDTO> webPay(WechatWebPayRequestDTO request) {
        return SpringContextHandler.getBean(WechatPayService.class).webPay(request);
    }

}
